//
//  LivingTableViewCell.m
//  SheShiDu
//
//  Created by 泉  姜 on 16/6/14.
//  Copyright © 2016年 单剑秋. All rights reserved.
//

#import "LivingTableViewCell.h"

#define HEIGHT self.contentView.frame.size.height
#define WIDTH self.contentView.frame.size.width
@implementation LivingTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.bottomImgView = [[UIImageView alloc] init];
//        _bottomImgView.backgroundColor = [UIColor cyanColor];
        _bottomImgView.layer.cornerRadius = 5;
        _bottomImgView.clipsToBounds = YES;
        [self.contentView addSubview:_bottomImgView];
        
        self.userBgImgView = [[JQImageView alloc] init];
//        _userBgImgView.backgroundColor = [UIColor colorWithRed:28 / 255.0 green:186 / 255.0 blue:173 /255.0 alpha:1];
        [_bottomImgView addSubview:_userBgImgView];
        
        self.userImgView = [[UIImageView alloc] init];
//        _userImgView.backgroundColor = [UIColor redColor];
        [_bottomImgView addSubview:_userImgView];
        
        self.browseImgView = [[UIImageView alloc] init];
//        _browseImgView.backgroundColor = [UIColor yellowColor];
        [_bottomImgView addSubview:_browseImgView];
        
        self.replyImgView = [[UIImageView alloc] init];
//        _replyImgView.backgroundColor = [UIColor yellowColor];
        [_bottomImgView addSubview:_replyImgView];
        
        self.titleLabel = [[UILabel alloc] init];
//        _titleLabel.backgroundColor = [UIColor yellowColor];
        _titleLabel.textColor = [UIColor whiteColor];
        _titleLabel.font = [UIFont systemFontOfSize:20];
        [_bottomImgView addSubview:_titleLabel];
        
        self.scaleLabel = [[UILabel alloc] init];
//        _scaleLabel.backgroundColor =[UIColor yellowColor];
        _scaleLabel.textColor = [UIColor whiteColor];
        _scaleLabel.font = [UIFont systemFontOfSize:14];
        [_bottomImgView addSubview:_scaleLabel];
        
        self.browseLabel = [[UILabel alloc] init];
//        _browseLabel.backgroundColor = [UIColor yellowColor];
        _browseLabel.textColor = [UIColor whiteColor];
        _browseLabel.font = [UIFont systemFontOfSize:13];
        [_bottomImgView addSubview:_browseLabel];
        
        self.replyLabel = [[UILabel alloc] init];
//        _replyLabel.backgroundColor = [UIColor yellowColor];
        _replyLabel.textColor = [UIColor whiteColor];
        _replyLabel.font = [UIFont systemFontOfSize:13];
        [_bottomImgView addSubview:_replyLabel];
    }
    return self;
}

- (void)layoutSubviews
{
    [super layoutSubviews];
    _bottomImgView.frame = CGRectMake(5, 5, WIDTH - 10, 200);
    _userBgImgView.frame = CGRectMake(5 , 200 - 45 - 5, 45, 45);
    _userImgView.frame = CGRectMake(5 + 2, 200 - 45 - 5, 36, 36);
    _titleLabel.frame = CGRectMake(5 + 45 + 10, 200 - 45 - 5, (WIDTH - 65) / 2, 28);
    _scaleLabel.frame = CGRectMake(5 + 45 + 10, 200 - 5 - 18, (WIDTH - 65) / 2, 17);
    _browseImgView.frame = CGRectMake(WIDTH - 10 - 5 - 30 - 20 - 45 - 23, 174, 23, 20);
    _browseLabel.frame = CGRectMake(WIDTH - 10 - 5 - 30 - 20 - 45, 175, 30, 20);
    _replyImgView.frame = CGRectMake(WIDTH - 10 - 5 - 30 - 20, 175, 17, 17);
    _replyLabel.frame = CGRectMake(WIDTH - 10 - 5 - 30, 175, 30, 20);
    
}

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
